module.exports = {
  httpConfig: {
    port: 62553,
  },
  mongoConfig: {
    host: 'mongodb://127.0.0.1:27017',
    db: 'footmark'
  },
  wxConfig: {
    
  },
  localConfig: {
    filePath: 'C:/WebApp/FileBase/koa/',
  },
  timeZoneSetting: function () {
    // node设置时区
    process.env.TZ = "Asia/Beijing";
    Date.prototype.TimeZone = new Map([
      ['Europe/London', 0],
      ['Asia/Beijing', 8],
      ['America/New_York', -5]
    ])
    Date.prototype.zoneDate = function (dt) {
      if (process.env.TZ == undefined) {
        return new Date();
      } else {
        for (let item of this.TimeZone.entries()) {
          if (item[0] == process.env.TZ) {
            let d = dt?new Date(dt):new Date();
            d.setHours(d.getHours() + item[1]);
            return d;
          }
        }
        return new Date();
      }
    }
    // console.log(new Date().zoneDate());
  }
}